package com.paipaideli.common.utils;

import android.annotation.SuppressLint;
import android.text.TextUtils;
import android.widget.Toast;
import com.paipaideli.MyApplication;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;

public class ToastUtil {

    @SuppressLint("CheckResult")
    public static void show(String message) {
        if(null!=message&& !TextUtils.isEmpty(message)){
            Observable.just(message).observeOn(AndroidSchedulers.mainThread()).subscribe(s ->
                            Toast.makeText(MyApplication.getInstance(), s, Toast.LENGTH_SHORT).show()
                    , throwable ->
                            LogUtil.d(throwable)
            );
        }
    }
}
